package com.ruoyan.dao;

import com.ruoyan.pojo.Books;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Package: com.ruoyan.dao
 * @ClassName: BooksMapper
 * @Author: ruoyan1998
 * @CreateTime: 2021/5/5 15:12
 * @Description:
 */
@Repository
public interface BooksMapper
{
    /**
     * 增加书籍
     * @param books
     * @return int*/
    int addBooks(Books books);

    /**
     * 删除书籍
     * @param id
     * @return int*/
    int deleteBooks(@Param("bookID") int id);

    /**
     * 更新书籍
     * @param books
     * @return int*/
    int updateBooks(Books books);

    /**
     * 查询所有书籍
     * @return List*/
    List<Books> queryBooks();

    /**
     * 根据ID查询书籍
     * @param id
     * @return Books*/
    Books queryBooksByID(@Param("bookID") int id);

    /**
     * 根据书名查询书籍
     * @param queryBookName
     * @return Books*/
    Books queryBookByName(@Param("bookName") String queryBookName);
}
